//
//  FavoriteView.m
//  MyProject
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 蓝鸥0825. All rights reserved.
//

#import "FavoriteView.h"
#import "FavoriteTableViewCell.h"



@implementation FavoriteView

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
    
}

- (void)create{
    
    self.tableViewfavorite = [[UITableView alloc] initWithFrame:self.frame style:UITableViewStylePlain];
    [self addSubview:self.tableViewfavorite];
    self.tableViewfavorite.dataSource = self;
    self.tableViewfavorite.delegate = self;
    self.tableViewfavorite.rowHeight = self.frame.size.height / 66 * 14;
    self.tableViewfavorite.separatorStyle = UITableViewCellSeparatorStyleNone;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *reuse = @"reuse";
    FavoriteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    
    if (!cell) {
        cell = [[FavoriteTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuse];
    }
    cell.imageFavoriteTaste.image = [UIImage imageNamed:@"imageFavoriteTaste.png"];
    cell.imageFavoriteTime.image = [UIImage imageNamed:@"imageFavoriteTime"];
    cell.model = self.arr[indexPath.row];
    return  cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [UMSocialSnsService presentSnsIconSheetView:self.VC
                                         appKey:@"507fcab25270157b37000010"
                                      shareText:@"你要分享的文字"
                                     shareImage:[UIImage imageNamed:@"icon.png"]
                                shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToWechatSession,UMShareToQQ,nil]
                                       delegate:self];
    

}





@end
